﻿#include <qg/qg.h>

int main(void)
{
	k_mesg("WIDGET READ TEST\n");

	qgDevice* dev = qgDevice::New(NULL, 640, 480, QGSDF_MSAA | QGSDF_LAYOUT);

	if (dev)
	{
		dev->Mount();

		qgStub* stub = dev->GetStub();
		qgFreeType* font = qgFreeType::New();

		qgWidgetShed* wg = qgWidgetShed::New("qg_widgetshed.xml");

		while (dev->Run())
		{
			float adv = stub->GetAdvance();

			dev->Enter();

			wg->Update(adv);
			wg->Draw();

			font->WriteFormat(5, 5, 0, "[%.2f]", stub->GetRunFps());

			dev->Leave();
			dev->Flush();
		}

		wg->Unload();
		font->Unload();
		dev->Unload();
	}

	return 0;
}
